import { defineComponent, openBlock, createBlock } from 'vue';

var script$1 = defineComponent({
    name: "WButton"
});

function render$1(_ctx, _cache, $props, $setup, $data, $options) {
  return (openBlock(), createBlock("button", null, "按钮"))
}

script$1.render = render$1;
script$1.__file = "packages/button/src/button.vue";

script$1.install = (app) => {
    // 全局注册组件
    console.log('button组件注册全局');
    app.component(script$1.name, script$1);
};
let _Button = script$1;
// createApp({}).use(_Button); // use调用，需要组件提供install方法

var script = defineComponent({
    name: 'WIcon',
    props: {
        name: {
            type: String,
            default: ''
        }
    }
});

function render(_ctx, _cache, $props, $setup, $data, $options) {
  return (openBlock(), createBlock("i", {
    class: `w-icon-${_ctx.name}`
  }, null, 2 /* CLASS */))
}

script.render = render;
script.__file = "packages/icon/src/icon.vue";

script.install = (app) => {
    // 全局注册组件
    app.component(script.name, script);
};
let _Icon = script;
// createApp({}).use(_Button); // use调用，需要组件提供install方法

const components = [
    _Button,
    _Icon
];
const install = (app) => {
    components.forEach(component => {
        // 遍历组件，挂载到全局
        let name = 'W' + component.name.slice(0, 1).toUpperCase() + component.name.slice(1);
        console.log(component.name, name);
        app.component(component.name, component);
    });
};
var index = {
    install // 导出install方法。createApp({}).use() 需要install方法
};

export default index;
